package com.xiaobao.controller;

import com.xiaobao.pojo.ExamPreparationPlanning;
import com.xiaobao.pojo.Result;
import com.xiaobao.service.ExamPlanningService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

//用于备考规划的数据获取和处理
@RestController
public class ExamPlanningController {
    final
    ExamPlanningService examPlanningService;

    public ExamPlanningController(ExamPlanningService examPlanningService) {
        this.examPlanningService = examPlanningService;
    }

    /**
 * 根据用户ID获取考试准备计划
 *
 * @param userid 用户ID，用于识别特定用户的考试准备计划
 * @return 返回ExamPreparationPlanning数组的Result对象，包含用户考试准备计划数据
 */
@GetMapping("/getExamPlanning/{userid}")
public Result<ExamPreparationPlanning []> getExamPreparationPlanning(@PathVariable String userid){
    return new Result<>(examPlanningService.getExamPreparationPlanning(userid));
}

}
